//定义全局点击跳转功能插件
export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.provide("commonOpen", (item) => {
    console.log(111111111,item)
    if (item.type == "webview") {
      // window.open(item.url);
      // 暂时放出来
      navigateTo(`/detail/courses/${item.course_id}`)
    }else if (item.type == "course") {
      navigateTo(`/detail/courses/${item.course_id}`);
    }else {
      navigateTo(`/goods/${item.id}`);
    }
  });
  // 设置点击卡片
  nuxtApp.provide("commonOpenGoods", (item) => {
      navigateTo(`/goods/${item.id}`);

  });
});
